﻿<UserControl x:Class="Gao.Poker.App.Members.MemberView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:userControls="clr-namespace:Gao.Poker.App.UserControls"
             mc:Ignorable="d" d:DesignHeight="135">
    <TabControl Margin="0" FontSize="14" Background="#FFD4D0C8">
        <TabItem Header="会员基本信息">
            <Grid Margin="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="90"/>
                    <ColumnDefinition Width="300"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="85"/>
                    <RowDefinition Height="50"/>
                </Grid.RowDefinitions>

                <TextBlock Text="卡号：" Margin="1" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" FontSize="14"/>
                <TextBlock Text="{Binding Path=Member.CardNo}" Margin="1" Grid.Column="1" VerticalAlignment="Center" Grid.Row="0" FontSize="14"/>

                <TextBlock Text="姓名："  Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" FontSize="14"/>
                <TextBlock Text="{Binding Path=Member.Name}" Margin="1" VerticalAlignment="Center"  Grid.Column="1" Grid.Row="1" FontSize="14"/>

                <TextBlock Text="生日：" HorizontalAlignment="Right" Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" FontSize="14"/>
                <TextBlock Margin="1" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" Text="{Binding Member.Birthday, StringFormat='yyyy-MM-dd'}" FontSize="14"/>

                <TextBlock Text="电话：" HorizontalAlignment="Right" Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" FontSize="14"/>
                <TextBlock Text="{Binding Member.Telephone}" Margin="1" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" FontSize="14"/>

                <TextBlock Text="E-Mail：" HorizontalAlignment="Right" Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="4" FontSize="14"/>
                <TextBlock Text="{Binding Member.Email}" Margin="1" VerticalAlignment="Center" Grid.Column="1" Grid.Row="4" FontSize="14"/>

                <TextBlock Text="消费金额：" HorizontalAlignment="Right" Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="5" FontSize="14"/>
                <TextBlock Text="{Binding Member.ConsumeMoney}" Margin="1" VerticalAlignment="Center" Grid.Column="1" Grid.Row="5" FontSize="14"/>

                <TextBlock Text="积分：" HorizontalAlignment="Right" Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="6" FontSize="14"/>
                <TextBlock Text="{Binding Member.Points}" Margin="1" VerticalAlignment="Center" Grid.Column="1" Grid.Row="6" FontSize="14"/>

                <TextBlock Text="地址：" HorizontalAlignment="Right" Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="7" FontSize="14"/>
                <TextBlock Text="{Binding Member.Address}" Margin="1" VerticalAlignment="Center" Grid.Column="1" Grid.Row="7" FontSize="14"/>

                <TextBlock Text="身份证：" HorizontalAlignment="Right" Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="8" FontSize="14"/>
                <TextBlock Text="{Binding Member.IdNo}" Margin="1" VerticalAlignment="Center" Grid.Column="1" Grid.Row="8" FontSize="14"/>

                <TextBlock Text="开卡时间：" HorizontalAlignment="Right" Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="9" FontSize="14"/>
                <TextBlock Text="{Binding Member.OpenCardDate, StringFormat='yyyy-MM-dd hh:mm:ss'}"  VerticalAlignment="Center"  Margin="1" Grid.Column="1" Grid.Row="9" FontSize="14"/>

                <TextBlock Text="备注：" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="10" FontSize="14"/>
                <TextBlock Text="{Binding Member.Remark, Mode=TwoWay}" Margin="1" VerticalAlignment="Top" Grid.Column="1" Grid.Row="10" Height="80" FontSize="14"/>

            </Grid>
        </TabItem>
        <TabItem Header="比赛记录">
            <DataGrid Margin="1" VerticalAlignment="Top" RowHeight="30" AutoGenerateColumns="False"
                    SelectionMode="Single"  CanUserAddRows="True"
                    ItemsSource="{Binding MembersGameRecords}" IsReadOnly="True"
                    FontSize="16" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="比赛名称" Width="*"  Binding="{Binding Path=GameName}"/>
                    <DataGridTextColumn Header="名次" Width="40" Binding="{Binding Path=Rank}"/>
                    <DataGridTextColumn Header="奖金" Width="60"   Binding="{Binding Path=Bonus}"/>
                    <DataGridTextColumn Header="买入" Width="40"   Binding="{Binding Path=BuyNumber}"/>
                    <DataGridTextColumn Header="重新买入" Width="80"   Binding="{Binding Path=BuyAgainNumber}"/>
                    <DataGridTextColumn Header="最后买入" Width="80" Binding="{Binding Path=BuyLastNumber}"/>
                    <DataGridTextColumn Header="买入金额" Width="80"  Binding="{Binding Path=BuyMoney}"/>
                </DataGrid.Columns>
            </DataGrid>
        </TabItem>
        <TabItem Header="消费记录">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#A1C7CFDA" Offset="0.991"/>
                        <GradientStop Color="#B5F1F1F1"/>
                        <GradientStop Color="#FFD2D2D2" Offset="1"/>
                    </LinearGradientBrush>
                </Grid.Background>
                <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="1">
                    <TextBlock Text="开始时间：" Margin="10,5,0,5" FontSize="14" VerticalAlignment="Center" />
                    <DatePicker SelectedDate="{Binding Path=LogStartDate}" Width="120" Margin="0,5,0,5" FontSize="14" />
                    <TextBlock Text="结束时间：" Margin="5,5,0,5" FontSize="14" Width="67" VerticalAlignment="Center" />
                    <DatePicker SelectedDate="{Binding Path=LogEndDate}" Margin="0,5,0,5" Width="120" FontSize="14" />
                    <Button Margin="60,1,1,1" Width="55" Style="{DynamicResource Orrange}" Content="查询" Command="{Binding SearchLogCommand}"/>
                </StackPanel>
                <DataGrid Grid.Row="1" Margin="1" VerticalAlignment="Top" RowHeight="30" AutoGenerateColumns="False"
                    SelectionMode="Single"  CanUserAddRows="True"
                    ItemsSource="{Binding MemberRecords}" IsReadOnly="True"
                    FontSize="16" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="消费类型" Width="200"  Binding="{Binding Path=CreateDt, StringFormat='yyyy-MM-dd hh:mm:ss'}"/>
                        <DataGridTextColumn Header="消费类型" Width="150"  Binding="{Binding Path=TypeName}"/>
                        <DataGridTextColumn Header="金额" Width="100" Binding="{Binding Path=Money}"/>
                        <DataGridTextColumn Header="积分" Width="*"   Binding="{Binding Path=Points}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
        </TabItem>
        <TabItem Header="购买记录">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#A1C7CFDA" Offset="0.991"/>
                        <GradientStop Color="#B5F1F1F1"/>
                        <GradientStop Color="#FFD2D2D2" Offset="1"/>
                    </LinearGradientBrush>
                </Grid.Background>
                <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="1">
                    <TextBlock Text="开始时间：" Margin="10,5,0,5" FontSize="14" VerticalAlignment="Center" />
                    <DatePicker SelectedDate="{Binding Path=SaleStartDate}" Width="120" Margin="0,5,0,5" FontSize="14" />
                    <TextBlock Text="结束时间：" Margin="5,5,0,5" FontSize="14" Width="67" VerticalAlignment="Center" />
                    <DatePicker SelectedDate="{Binding Path=SaleEndDate}" Margin="0,5,0,5" Width="120" FontSize="14" />
                    <Button Margin="60,1,1,1" Width="55" Style="{DynamicResource Orrange}" Content="查询" Command="{Binding SearchConsumptionsCommand}"/>
                </StackPanel>
                <ItemsControl Grid.Row="1" ItemsSource="{Binding Consumptions}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <userControls:SalesRecord />
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Grid>

        </TabItem>
    </TabControl>
</UserControl>
